<!DOCTYPE html><html><head><title>Ext.util.CSS | Ext JS 4.0 Documentation</title><script type="text/javascript" src="../ext-all.js"></script><link rel="stylesheet" href="../reset.css" type="text/css"><link rel="stylesheet" href="../scrollbars.css" type="text/css"><link rel="stylesheet" href="../docs.css" type="text/css"><link id="styleCss" rel="stylesheet" href="../style.css" type="text/css"><script type="text/javascript" src="../prettify.js"></script><link rel="stylesheet" href="../prettify.css" type="text/css"><!-- link(rel: 'stylesheet', href: req.baseURL + '/css/ext4.css', type: 'text/css')--><link rel="shortcut icon" type="image/ico" href="../favicon.ico"><!--[if IE]>
<style type="text/css">.head-band { display: none; }
.header { border: 0; top: 0; left: 0px; background: url(../header.gif) repeat-x; }
.doc-tab .members .member a.more { background-color: #efefef; }
</style><link rel="stylesheet" href="/new/css/ie.css" type="text/css"><![endif]-->
</head><body id="ext-body" class="iScroll"><div id="notice" class="notice">For up to date documentation and features, visit 
<a href="http://docs.sencha.com/ext-js/4-0">http://docs.sencha.com/ext-js/4-0</a></div><div class="wrapper"><div class="head-band"></div><div class="header"><h2><a href="../index.html">Sencha Documentation</a></h2></div><div id="search"><form><input type="text" placeholder="Search" id="search-field" autocomplete="off" name="q"></form><div id="search-box"></div></div><div id="treePanel"></div><div id="container"><script type="text/javascript">

    req = {
        liveURL: '.',
        standAloneMode: true,
        origDocClass: 'Ext.util.CSS',
        docClass: 'Ext.util.CSS',
        docReq: 'Ext.util.CSS',
        version: '4.0',
        baseURL: '.',
        baseDocURL: '.',
        baseProdURL: '.'
    };

    clsInfo = {};



</script>

<script type="text/javascript" src="../search.js"></script>
<!--script type="text/javascript" src="/new/javascripts/app/examples.js"></script-->
<script type="text/javascript" src="../class_tree.js"></script>
<script type="text/javascript" src="../class_doc.js"></script>
<script type="text/javascript">
    req.source = 'CSS.html#Ext-util.CSS';
    clsInfo = {"methods":["createStyleSheet","getRule","getRules","refreshCache","removeStyleSheet","swapStyleSheet","updateRule"],"cfgs":[],"properties":[],"events":[],"subclasses":[]};
    Ext.onReady(function() {
        Ext.create('Docs.classPanel');
    });
</script><div id="top-block" class="top-block"><h1 id="clsTitle" class="cls"><a href="../source/CSS.html#Ext-util.CSS" target="_blank">Ext.util.CSS</a></h1></div><div id="docContent"><div id="doc-overview-content"><div class="lft"><p>Utility class for manipulating CSS rules</p>
<div class="members"><div class="m-methods"><a name="methods"></a><div class="definedBy">Defined By</div><h3 class="mth p">Methods</h3><div id="method-createStyleSheet" class="member f ni"><a href="Ext.util.CSS.html#method-createStyleSheet" rel="method-createStyleSheet" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.util.CSS.html" class="definedIn docClass">Ext.util.CSS</a><br/><a href="../source/CSS.html#Ext-util.CSS-method-createStyleSheet" class="viewSource">view source</a></div><a name="createStyleSheet"></a><a name="method-createStyleSheet"></a><a href="Ext.util.CSS.html#" rel="method-createStyleSheet" class="cls expand">createStyleSheet</a>(
<span class="pre">String cssText, String id</span>)
 : StyleSheet</div><div class="description"><div class="short">Creates a stylesheet from a text blob of rules.
These rules will be wrapped in a STYLE tag and appended to the HEAD o...</div><div class="long"><p>Creates a stylesheet from a text blob of rules.
These rules will be wrapped in a STYLE tag and appended to the HEAD of the document.</p>
<h3 class="pa">Parameters</h3><ul><li><span class="pre">cssText</span> : String<div class="sub-desc"><p>The text containing the css rules</p>
</div></li><li><span class="pre">id</span> : String<div class="sub-desc"><p>An id to add to the stylesheet for later removal</p>
</div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">StyleSheet</span>&nbsp; &nbsp;
</li></ul></div></div></div><div id="method-getRule" class="member ni"><a href="Ext.util.CSS.html#method-getRule" rel="method-getRule" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.util.CSS.html" class="definedIn docClass">Ext.util.CSS</a><br/><a href="../source/CSS.html#Ext-util.CSS-method-getRule" class="viewSource">view source</a></div><a name="getRule"></a><a name="method-getRule"></a><a href="Ext.util.CSS.html#" rel="method-getRule" class="cls expand">getRule</a>(
<span class="pre">String/Array selector, Boolean refreshCache</span>)
 : CSSRule</div><div class="description"><div class="short"><p>Gets an an individual CSS rule by selector(s)</p>
</div><div class="long"><p>Gets an an individual CSS rule by selector(s)</p>
<h3 class="pa">Parameters</h3><ul><li><span class="pre">selector</span> : String/Array<div class="sub-desc"><p>The CSS selector or an array of selectors to try. The first selector that is found is returned.</p>
</div></li><li><span class="pre">refreshCache</span> : Boolean<div class="sub-desc"><p>true to refresh the internal cache if you have recently updated any rules or added styles dynamically</p>
</div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">CSSRule</span>&nbsp; &nbsp;<p>The CSS rule or null if one is not found</p>
</li></ul></div></div></div><div id="method-getRules" class="member ni"><a href="Ext.util.CSS.html#method-getRules" rel="method-getRules" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.util.CSS.html" class="definedIn docClass">Ext.util.CSS</a><br/><a href="../source/CSS.html#Ext-util.CSS-method-getRules" class="viewSource">view source</a></div><a name="getRules"></a><a name="method-getRules"></a><a href="Ext.util.CSS.html#" rel="method-getRules" class="cls expand">getRules</a>(
<span class="pre">Boolean refreshCache</span>)
 : Object</div><div class="description"><div class="short"><p>Gets all css rules for the document</p>
</div><div class="long"><p>Gets all css rules for the document</p>
<h3 class="pa">Parameters</h3><ul><li><span class="pre">refreshCache</span> : Boolean<div class="sub-desc"><p>true to refresh the internal cache</p>
</div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">Object</span>&nbsp; &nbsp;<p>An object (hash) of rules indexed by selector</p>
</li></ul></div></div></div><div id="method-refreshCache" class="member ni"><a href="Ext.util.CSS.html#method-refreshCache" rel="method-refreshCache" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.util.CSS.html" class="definedIn docClass">Ext.util.CSS</a><br/><a href="../source/CSS.html#Ext-util.CSS-method-refreshCache" class="viewSource">view source</a></div><a name="refreshCache"></a><a name="method-refreshCache"></a><a href="Ext.util.CSS.html#" rel="method-refreshCache" class="cls expand">refreshCache</a> : Object</div><div class="description"><div class="short"><p>Refresh the rule cache if you have dynamically added stylesheets</p>
</div><div class="long"><p>Refresh the rule cache if you have dynamically added stylesheets</p>
<h3 class="pa">Returns</h3><ul><li><span class="pre">Object</span>&nbsp; &nbsp;<p>An object (hash) of rules indexed by selector</p>
</li></ul></div></div></div><div id="method-removeStyleSheet" class="member ni"><a href="Ext.util.CSS.html#method-removeStyleSheet" rel="method-removeStyleSheet" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.util.CSS.html" class="definedIn docClass">Ext.util.CSS</a><br/><a href="../source/CSS.html#Ext-util.CSS-method-removeStyleSheet" class="viewSource">view source</a></div><a name="removeStyleSheet"></a><a name="method-removeStyleSheet"></a><a href="Ext.util.CSS.html#" rel="method-removeStyleSheet" class="cls expand">removeStyleSheet</a>(
<span class="pre">String id</span>)
 : void</div><div class="description"><div class="short"><p>Removes a style or link tag by id</p>
</div><div class="long"><p>Removes a style or link tag by id</p>
<h3 class="pa">Parameters</h3><ul><li><span class="pre">id</span> : String<div class="sub-desc"><p>The id of the tag</p>
</div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">void</span>&nbsp; &nbsp;
</li></ul></div></div></div><div id="method-swapStyleSheet" class="member ni"><a href="Ext.util.CSS.html#method-swapStyleSheet" rel="method-swapStyleSheet" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.util.CSS.html" class="definedIn docClass">Ext.util.CSS</a><br/><a href="../source/CSS.html#Ext-util.CSS-method-swapStyleSheet" class="viewSource">view source</a></div><a name="swapStyleSheet"></a><a name="method-swapStyleSheet"></a><a href="Ext.util.CSS.html#" rel="method-swapStyleSheet" class="cls expand">swapStyleSheet</a>(
<span class="pre">String id, String url</span>)
 : void</div><div class="description"><div class="short"><p>Dynamically swaps an existing stylesheet reference for a new one</p>
</div><div class="long"><p>Dynamically swaps an existing stylesheet reference for a new one</p>
<h3 class="pa">Parameters</h3><ul><li><span class="pre">id</span> : String<div class="sub-desc"><p>The id of an existing link tag to remove</p>
</div></li><li><span class="pre">url</span> : String<div class="sub-desc"><p>The href of the new stylesheet to include</p>
</div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">void</span>&nbsp; &nbsp;
</li></ul></div></div></div><div id="method-updateRule" class="member ni"><a href="Ext.util.CSS.html#method-updateRule" rel="method-updateRule" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.util.CSS.html" class="definedIn docClass">Ext.util.CSS</a><br/><a href="../source/CSS.html#Ext-util.CSS-method-updateRule" class="viewSource">view source</a></div><a name="updateRule"></a><a name="method-updateRule"></a><a href="Ext.util.CSS.html#" rel="method-updateRule" class="cls expand">updateRule</a>(
<span class="pre">String/Array selector, String property, String value</span>)
 : Boolean</div><div class="description"><div class="short"><p>Updates a rule property</p>
</div><div class="long"><p>Updates a rule property</p>
<h3 class="pa">Parameters</h3><ul><li><span class="pre">selector</span> : String/Array<div class="sub-desc"><p>If it's an array it tries each selector until it finds one. Stops immediately once one is found.</p>
</div></li><li><span class="pre">property</span> : String<div class="sub-desc"><p>The css property</p>
</div></li><li><span class="pre">value</span> : String<div class="sub-desc"><p>The new value for the property</p>
</div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">Boolean</span>&nbsp; &nbsp;<p>true If a rule was found and updated</p>
</li></ul></div></div></div></div></div></div></div><div id="pageContent"></div></div></div></div></body></html>